/**
 * @Author: Yosoo
 * @Date: 2025/5/17 10:10
 * @Description:
 */
package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishMapper {

    @AutoFill(OperationType.INSERT)
    void insert(Dish dish);

    Page<DishVO> pageQuery(Dish dish);


    Dish getById(Long id);

    void deleteByIds(List<Long> ids);

    /**
     * 根据id查询菜品和口味信息
     * @Author:     Yosoo
     * @Date:       2025/5/17 14:10
     * @Description:
     * @param id
     * @return
     */
    DishVO getDishWithFlavorById(Long id);

    /**
     * 修改菜品
     * @Author:     Yosoo
     * @Date:       2025/5/17 14:38
     * @Description:
     * @param dish
     */
    @AutoFill(OperationType.UPDATE)
    void update(Dish dish);

    List<DishVO> list(Long categoryId);
}
